//---------------------------------------------------------------------
// This is the top of the Type hierarchy. You most likely will need to
// create sub-classes (since this one is abstract) that handle specific
// types, such as IntType, FloatType, ArrayType, etc.
//---------------------------------------------------------------------

abstract class Type
{
	// Name of the Type (e.g., int, bool, or some typedef
	private String m_typeName;
	private int m_size;
	private boolean isTypedef ;

	private boolean isDeclType ;

	

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public Type(String strName, int size)
	{
		setName(strName);
		setSize(size);
	}
	
	public Type (Type t) {
		setName(t.getName());
		setSize(t.getSize());
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public String getName()
	{
		return m_typeName;
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public void setName(String str)
	{
		m_typeName = str;
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public int getSize()
	{
		return m_size;
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public void setSize(int size)
	{
		m_size = size;
	}

	
	public boolean isDeclType() {
		return isDeclType;
	}

	public void setisDeclType(boolean isDeclType) {
		this.isDeclType = isDeclType;
	}
	
	
	//----------------------------------------------------------------
	//	It will be helpful to ask a Type what specific Type it is.
	//	The Java operator instanceof will do this, but you may
	//	also want to implement methods like isNumeric(), isInt(),
	//	etc. Below is an example of isInt(). Feel free to
	//	change this around.
	//----------------------------------------------------------------
	public boolean isInt ()	{ return false; }  // NumericType
	
	/***************CHECK 1: ADDED TYPE CHECKING METHODS ******************/
	public boolean isFloat() { return false; } // NumericType
	public boolean isNumeric() {
		return isInt() || isFloat();
	}
	public boolean isBasic() { return false; }
	public boolean isBool() { return false; } // BoolType
	public boolean isVoid() { return false; } // VoidType
	public boolean isComposite() { return false; }
	public boolean	isArrayType ()	{ return false; } // ArrayType
	public boolean	isStructType ()	{ return false; } // StructType
	public boolean	isPtrGrpType ()	{ return false; } // PtrGrpType
	public boolean	isFuncPtrType () { return false; }
	public boolean	isPointerType()	{ return false; }
	public boolean isNullPtrType() { return false; }
	
	/************* CHECK 5: ADDED ISASSIGNABLE/EQUIVALENT METHOD ******************/
	public boolean isAssignableTo(Type t) { return false; }
	public boolean isEquivalentTo(Type t) { return false; }

	public boolean isTypedef() {
		return isTypedef;
	}

	public void setTypedef(boolean isTypedef) {
		this.isTypedef = isTypedef;
	}
}
